#!/usr/bin/python
#-*- coding:utf-8 -*-
###########################################################################################################
#													  #
# Name: wxSoft												  #
# Author: Alessio'Alexei95' Colucci <alessio.colucci@live.it>						  #
# Copyright: Copyright (C) 2009 Alessio 'Alexei95' Colucci						  #
# License:												  #
#													  #
#	wxSoft is a combination of Editor, client BitTorrent, ... written in Python (GUI - wxPython)	  #
#													  #
#	Copyright (C) 2009  Alessio "Alexei95" Colucci							  #
#													  #
#	wxSoft is free software: you can redistribute it and/or modify					  #
#	it under the terms of the GNU General Public License as published by				  #
#	the Free Software Foundation, either version 3 of the License, or				  #
#	any later version.										  #
#													  #
#	wxSoft is distributed in the hope that it will be useful,					  #
#	but WITHOUT ANY WARRANTY; without even the implied warranty of					  #
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the					  #
#	GNU General Public License for more details.							  #
#													  #
#	You should have received a copy of the GNU General Public License				  #
#	along with wxSoft.  If not, see <http://www.gnu.org/licenses/>.					  #
#													  #
# For bug visit code.google.com/p/wxsoft/issues/list or write an e-mail to bugpythonprojects@gmail.com	  #
#													  #
###########################################################################################################
__version__ = "0.1a1"
def main():
	import lib.functions
	app = lib.functions.check_module()
	import wx, wxedit.lib.gui, wxtorrent.lib.gui, sys, lib.classes, os
	lib.functions.firstopen(sys.argv)
	a = wx.PySimpleApp()
	dlg = wx.SingleChoiceDialog(None, "Select program to open", "Select Program", app)
	if dlg.ShowModal() == wx.ID_OK:
			if dlg.GetStringSelection() == "wxEdit":
				app = lib.classes.App(__version__, wxedit.lib.gui)
				app.MainLoop()
			elif dlg.GetStringSelection() == "wxTorrent":
				app = lib.classes.App(__version__, wxtorrent.lib.gui)
				app.MainLoop()
	else:
		sys.exit(0)
	#main_ = lib.functions.autocheck(__version__)
	#if main_:
	#	import main
	#	main.main()
	#else:
	if lib.functions.already_open():
		pass
	else:
		a.MainLoop()
if __name__ == "__main__":
	main()